# 定义函数 set_operations
def set_operations(set1, set2):
    # 计算并集、交集和差集
    union_set = set1.union(set2)  # 并集
    intersection_set = set1.intersection(set2)  # 交集
    difference_set = set1.difference(set2)  # 差集（set1 相对于 set2 的差集）

    # 初始化新集合，用于存储交集中是偶数的元素
    even_intersection = set()

    # 遍历交集，检查每个元素是否为偶数
    for element in intersection_set:
        if element % 2 == 0:  # 判断是否为偶数
            even_intersection.add(element)

    # 返回并集、差集和 even_intersection 集合
    return union_set, difference_set, even_intersection

# 定义两个集合
set1 = {1, 2, 3, 4}
set2 = {3, 4, 5, 6}

# 调用函数
union_result, difference_result, even_intersection_result = set_operations(set1, set2)

# 打印结果
print("并集:", union_result)
print("差集:", difference_result)
print("交集中的偶数集合:", even_intersection_result)